// var info1 = [68,30,'item1'];
// var info2 = [23,49,'item2'];
// var info3 = [40,48,'item3'];
// var item1 ={value1:68,value2:30,name:'item1'};
// var item2 ={value1:23,value2:49,name:'item2'};
// var item3 ={value1:40,value2:48,name:'item3'};
// var thedata = [item1,item2,item3];
// var thedata2 = [info1,info2,info3];
var mCharts = echarts.init(document.querySelector("#linerRe"));
var regr = ecStat.regression('linear',linepoint,{dimensions:[0,1]});
var option = {
	title:{
		text:'散点',
		left:'40%',
		textStyle:{
			fontSize:20
		},
		subtext:'+线性回归',
		subtextStyle:{
			fontSize:30,
			color:'red',
			fontWeight:'bolder',
			fontStyle:'italic'
		}
	},
	legend: {},
	tooltip: {
		trigger: "item",
		axisPointer: {
			  type: "shadow"
			},
		position: function (pos, params, el, elRect, size) {
			var obj = {top: 10};
			obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
			return obj;
		},
		extraCssText: 'width: 170px'
	},
	grid:[
		{bottom:61},
		{height:60,
		bottom:0}
	],
	dataset:[
		{
		  source: scadata
		}
		// ,{
		//   transform: {
		// 	type: 'ecStat:regression'
		// 	// 'linear' by default.
		// 	// config: { method: 'linear', formulaOn: 'end'}
		//   }
		// }
		],
	xAxis:{
		type:'value',
		scale:true
	},

	yAxis:{
		type:'value'
		,scale:true
	},
	series:[
		{
			symbolSize:10,
			type:'scatter'
		},
		{
		  name: 'line',
		  type: 'line',
		  data:regr.points,
		  datasetIndex: 1,
		  symbolSize: 0.1,
		  symbol: 'circle',
		  label: { show: false,formatter: '{b}: {@deny}' },
		  // labelLayout: { dx: -20 },
		  encode: { label: 2, tooltip: 1 }
		}
	]
};
mCharts.setOption(option)